#include "app/window.hpp"
#include "app/vulkan_triangle.hpp"
#include <quill/Quill.h>
#include <quill/handlers/ConsoleHandler.h>

int main(int, char **)
{
    auto stdout_handler = quill::stdout_handler();
    auto file_handler = quill::rotating_file_handler("ExampleVk.log", "w", 16 << 20, 4);
    quill::Config cfg{
        .default_handlers = {stdout_handler, file_handler},
        .enable_console_colours = true,
    };
    quill::configure(cfg);
    quill::start();
    stdout_handler->set_pattern(
        QUILL_STRINGIFY([%(ascii_time)][%(thread:<6)][%(level_name:^9)](%(filename):%(lineno)): %(message)),
        "%F %H:%M:%S.%Qms",
        quill::Timezone::LocalTime);
    file_handler->set_pattern(
        QUILL_STRINGIFY([%(ascii_time)][%(thread:<6)][%(level_name:^9)](%(filename):%(lineno)): %(message)),
        "%F %H:%M:%S.%Qms",
        quill::Timezone::LocalTime);
    quill::get_logger()->set_log_level(quill::LogLevel::TraceL3);


    core::app::Window example {1440, 900, "Example Vk App"};
    core::app::VulkanTriangle triangle;

    example.SetApp(&triangle);

    return example.AppRun();
}
